#include <iostream>
#include <string>
#include <memory>

#include "server.hpp"

void Usage()
{
    printf("Using Warning , Please use the correct manual: \n ./server.cc ip port\n");
}

// .server.cc 0.0.0.0 8080
int main(int argc, char* argv[])
{
    if (argc != 3)
    {
        Usage();
        exit(1);
    }

    std::string ip = argv[1];
    uint16_t port = atoi(argv[2]);
    std::unique_ptr<UdpServer> ptr(new UdpServer(port, ip));
    ptr->InitServer();
    ptr->Start();

    return 0;
}